测试链接：https://leetcode.cn/problems/B1IidL/description/
class Solution {
public:
    int peakIndexInMountainArray(vector<int>& arr) {
        int n = arr.size();
        int l = 0;
        int r = n - 1;
        while(l < r)
        {
            int mid = l + (r - l + 1)/2;
            if(arr[mid] > arr[mid - 1])
            {
                l = mid;
            }
            else
            {
                r = mid - 1;
            }
        }
        return l;
    }
};